#include <iostream>
#include <thread>

#include "../common/TimerWheel.hpp"

void task_func1()
{
    std::cout << "任务1执行" << std::endl;
}

void task_func2()
{
    std::cout << "任务2执行" << std::endl;
}

int main()
{
    TimerWheel wheel;
    std::thread t1([&]{
        while(true){
            static int count = 1;
            std::cout << "当前时间:" << count++ << std::endl;
            sleep(1);
            wheel.runTimerTask();
        } 
    });

    wheel.TimerAdd(1, 5, task_func1);
    wheel.TimerAdd(2, 5, task_func2);
    wheel.TimerCancel(2);

    
    // sleep(4);
    // wheel.TimerRefresh(2);

    t1.join();
    return 0;
}